package com.demo.spring_demo.mapper;

import com.demo.spring_demo.pojo.User;
import com.demo.spring_demo.pojo.UserAndUserInfo;
import com.demo.spring_demo.pojo.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.ResponseBody;

@Mapper
@ResponseBody
public interface UserInfoMapper {

    @Insert("insert into userinfo (id,username,phone) values (null,#{username},#{phone})")
    int addUserInfo(UserAndUserInfo userInfo);

    @Update("update userinfo set info=#{info},city=#{city},birthday=#{birthday},phone=#{phone} where username=#{username}")
    int updateUserInfo(UserInfo userInfo);



}
